import Vue from "vue";
import VueRouter from "vue-router";
import MyLogin from "@/view/login/MyLogin.vue";
import layout from "@/view/layout/HmmmIndex.vue";
import chart from "@/view/HmmmSjgl";
import user from "@/view/user";
import question from "@/view/HmmmTklb";
import business from "@/view/HmmmQylb";
import subject from "@/view/subjectList/index.vue";

Vue.use(VueRouter);

const routes = [
  { path: "/", redirect: "/layout/chart" },
  {
    name: "login",
    path: "/login",
    component: MyLogin,
    meta: { title: "登录" },
  },
  {
    path: "/layout",
    name: "layout",
    component: layout,
    children: [
      {
        path: "chart",
        name: "chart",
        component: chart,
        meta: { title: "数据概览" },
      },
      {
        path: "user",
        name: "user",
        component: user,
        meta: { title: "用户列表" },
      },
      {
        path: "question",
        name: "question",
        component: question,
        meta: { title: "题库列表" },
      },
      {
        path: "business",
        name: "business",
        component: business,
        meta: { title: "企业列表" },
      },
      {
        path: "subject",
        name: "subject",
        component: subject,
        meta: { title: "学科列表" },
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
